package Work4.Slay_the_Maze.Events;

import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;

import Work4.Slay_the_Maze.GameSystem.BattleSystem;
import Work4.Slay_the_Maze.Monsters.Monster;
import Work4.Slay_the_Maze.Monsters.MonstersPool;
import Work4.Slay_the_Maze.Player.Player;

public class RestEvent extends Events {
	public RestEvent() {
		super("休息","你发现了一处营地，休息一下吧");
	}
	public void TakeaRest(Player player) {
		Scanner sc=new Scanner(System.in);
		boolean isdone=false;
		do {
			System.out.println("选择 1:恢复所有丢弃牌");
			System.out.println("2:恢复所有丢弃牌，将生命值回满，但会清空护甲");
			while (!sc.hasNextInt()) {
			    System.out.println("输入无效，请输入一个整数:");
			    sc.next(); // 清除错误输入，避免死循环
			}
			int choice=sc.nextInt();
			if(choice==1) {
				player.resetfoldcards();
				isdone=true;
			}else if(choice==2) {
				player.resetfoldcards();
				player.setHp(player.getHplimit());
				player.setArmor(0);
				isdone=true;
			}else {
				System.out.println("输入错误");
			}
		}while(!isdone);
	}
	public void doit(Player player) {
		TakeaRest(player);
	}
}